package com.wn.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yellow Docter
 * @date 2022 -10-31
 * @desc
 */
@RequestMapping("/demo01")
@Slf4j
@RestController
//@RefreshScope    // 配置中心的文件 发生 变化 自动刷新
public class Demo01Controller {

//    @Value("${title}")
//    private String title;

    @Value("${server.port}")
    private Integer port;

    @GetMapping
    public String get(){
        return "hello" + port;
    }

}
